package com.probox.common.entity.vo.centre.product;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author Kite
 * @date 2021/6/8
 */
@ApiModel(description="商品数据汇总")
@Data
public class ProductDataVo {
    @ApiModelProperty(value = "商品ID")
    private String productUid;

    @ApiModelProperty(value = "商品名称")
    private String productName;

    @ApiModelProperty(value = "商品图片")
    private String carouselImg;

    @ApiModelProperty(value = "商品周比涨幅度")
    private String increase;

    /**
     * 商品访客数
     */
    @ApiModelProperty(value = "商品访客数")
    private Integer visitorsSum;
    /**
     * 商品浏览量
     */
    @ApiModelProperty(value = "商品浏览量")
    private Integer viewNumSum;
    /**
     * 商品总成交量
     */
    @ApiModelProperty(value = "商品总成交量")
    private Integer buyNumSum;
    /**
     * 商品总收藏数
     */
    @ApiModelProperty(value = "商品总收藏数")
    private Integer collectNumSum;
    /**
     * 总加入购物车数量
     */
    @ApiModelProperty(value = "总加入购物车数量")
    private Integer addCarNumSum;
    /**
     * 复购率
     */
    @ApiModelProperty(value = "复购率")
    private Double repurchaseRateSum;
    /**
     * 支付转化率
     */
    @ApiModelProperty(value = "支付转化率")
    private Double paymentConversionRateSum;

    /**
     * 过去访客数/比例
     */
    @ApiModelProperty(value = "过去访客数")
    private Double visitorsFormerly ;
    /**
     * 过去商品浏览数/比例
     */
    @ApiModelProperty(value = "过去商品浏览数")
    private Double viewNumFormerly ;

    /**
     * 过去商品成交额/比例
     */
    @ApiModelProperty(value = "过去商品成交额")
    private Double  buyNumFormerly ;

    /**
     * 过去收藏数/比例
     */
    @ApiModelProperty(value = "过去收藏数")
    private Double collectNumFormerly ;

    /**
     * 过去加入购物车数/比例
     */
    @ApiModelProperty(value = "过去加入购物车数")
    private Double addCarNumFormerly ;


    /**
     * 过去复购率/比例
     */
    @ApiModelProperty(value = "过去复购率")
    private Double repurchaseRateSumFormerly ;

    /**
     * 过去支付转化率/比例
     */
    @ApiModelProperty(value = "过去支付转化率")
    private Double paymentConversionRateFormerly ;

    public ProductDataVo( Integer visitorsSum, Integer viewNumSum, Integer buyNumSum, Integer collectNumSum, Integer addCarNumSum, Double repurchaseRateSum, Double paymentConversionRateSum, Double visitorsFormerly, Double viewNumFormerly, Double buyNumFormerly, Double collectNumFormerly, Double addCarNumFormerly, Double repurchaseRateSumFormerly, Double paymentConversionRateFormerly) {
        this.visitorsSum = visitorsSum;
        this.viewNumSum = viewNumSum;
        this.buyNumSum = buyNumSum;
        this.collectNumSum = collectNumSum;
        this.addCarNumSum = addCarNumSum;
        this.repurchaseRateSum = repurchaseRateSum;
        this.paymentConversionRateSum = paymentConversionRateSum;
        this.visitorsFormerly = visitorsFormerly;
        this.viewNumFormerly = viewNumFormerly;
        this.buyNumFormerly = buyNumFormerly;
        this.collectNumFormerly = collectNumFormerly;
        this.addCarNumFormerly = addCarNumFormerly;
        this.repurchaseRateSumFormerly = repurchaseRateSumFormerly;
        this.paymentConversionRateFormerly = paymentConversionRateFormerly;
    }

    public ProductDataVo(){};

    public String getCarouselImg() {
        if (carouselImg != null){
            String[] split = carouselImg.split(",");
            if (split != null && split.length > 0) {
                return carouselImg = split[0];
            }
        }

        return carouselImg;
    }


}
